<?php
/************************FoxPHP威客系统************************/
/*                                                            */
/*  FoxPHP.Com (C)2006-2016 FoxPHP Inc.                       */
/*  This is NOT a freeware, use is subject to license terms   */
/*  FoxPHP威客系统是商业软件,使用于商业用途请购买授权         */
/*  V3.0 2016.3                                               */
/*  foxphp@aliyun.com                                         */
/*  http://www.foxphp.com                                     */
/*                                                            */
/**************************************************************/

namespace Admin\Controller;
use Think\Controller;
class PayinController extends IndexController {
	
	//列表动作-----------------------------------------------------------------------------------------------
	public function indexAction(){
		
		$model=new \Admin\Model\ConsumeModel();

		$sqlwhere=array(' paytype=%d ',array('paytype'=>3));
		
		foreach($model->IndexGetData(
				//排序
				array(
					array('order'=>'id','name'=>'ID'),
					array('order'=>'serial','name'=>'流水号'),
					array('order'=>'payin_uid','name'=>'充值用户UID'),
					array('order'=>'payin_username','name'=>'充值用户名'),
					array('order'=>'subject','name'=>'标题'),
					array('order'=>'amount','name'=>'充值金额'),
					array('order'=>'process','name'=>'充值状态'),
					array('order'=>'dateline','name'=>'充值时间')
				),
				//查询
				array(	
					'id'=>array('id','int'),
					'payin_uid'=>array('payin_uid','int'),
					'payin_username'=>array('payin_username','string')
				)
				,
				'id DESC'
				,
				20				
				,
				$sqlwhere
				
			) as $key=>$value){
			$this->assign($key,$value);
		}

		$this->display();
	}
	
	//删除动作-----------------------------------------------------------------------------------------------
	public function deleteAction(){
		$model=new \Admin\Model\ConsumeModel();
		$result=$model->DeleteData();
		$this->error($result['message'],U(MODULE_NAME.'/'.CONTROLLER_NAME.'/index'),3);
	}
	
}